<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="Pragma" content="no-cache" /> 
<base href="<?php echo $this->config->config['base_url'] ?>" />
<title><?=$title?></title>
<!-- ext -->		
	<link rel="stylesheet" type="text/css" href="resources/js/ext/2.2/resources/css/ext-all.css"/>
<!-- Alternate style sheets -->
	<link rel="alternate stylesheet" type="text/css" href="resources/css/skins/xtheme-gray.css" title="xtheme-gray" />
	<link rel="alternate stylesheet" type="text/css" href="resources/css/skins/xtheme-olive.css" title="xtheme-olive" />
	<link rel="alternate stylesheet" type="text/css" href="resources/css/skins/xtheme-purple.css" title="xtheme-purple" />
	<link rel="alternate stylesheet" type="text/css" href="resources/css/skins/xtheme-slate.css" title="xtheme-slate" />	
	<link rel="alternate stylesheet" type="text/css" href="resources/css/skins/xtheme-silvercherry.css" title="xtheme-silvercherry" />	
	<link rel="alternate stylesheet" type="text/css" href="resources/css/skins/xtheme-green.css" title="xtheme-green" />	
	<link rel="alternate stylesheet" type="text/css" href="resources/css/skins/xtheme-indigo.css" title="xtheme-indigo" />		

<!-- ext javascript framework -->
	<script type="text/javascript" src="resources/js/ext/2.2/adapter/ext/ext-base.js"></script>	
	<script type="text/javascript" src="resources/js/ext/2.2/ext-all.js"></script>		
	<script type="text/javascript" src="resources/js/ext-used-features/layout.js"></script>	
	<script type="text/javascript" src="resources/js/ext-used-features/forms/Ext.ux.plugins.js"></script>
	<script type="text/javascript" src="resources/js/ext-used-features/editorgrid/Ext.ux.ComboRenderer.js"></script>	
	<script type="text/javascript" src="resources/js/ext-used-features/editorgrid/Ext.ux.GridValidator.js"></script>			
	<script type="text/javascript" src="resources/js/ext-used-features/grids/Ext.ux.SearchField.js"></script>	
	<script type="text/javascript" src="resources/js/ext-used-features/grids/Ext.ux.grid.PageSizer.js"></script>
	<script type="text/javascript" src="resources/js/ext-used-features/grids/Ext.ux.grid.Search.js"></script>	
	<script type="text/javascript" src="resources/js/ext-used-features/grids/Ext.ux.grid.GridSummary.js"></script>
	<link rel="stylesheet" type="text/css" href="resources/css/ext-used-features/Ext.ux.grid.GridSummary.css"/>		
<!--	<script type="text/javascript" src="resources/js/ext-used-features/EventManager.js"></script>	-->
	<script type="text/javascript" src="resources/js/ext-used-features/miframe-min.js"></script>

							
	<script type="text/javascript">
      Ext.onReady(function() { 
 		//default ext s.gif
		Ext.BLANK_IMAGE_URL = 'resources/js/ext/2.2/resources/images/default/s.gif';
		
		//set cookie
		Ext.state.Manager.setProvider(new Ext.state.CookieProvider());		
		
		//initiate quick tips
        Ext.QuickTips.init();
		
		//set default hint error message position
		Ext.form.Field.prototype.msgTarget = 'side';
		
		Ext.apply(Ext.DatePicker.prototype, {
		    todayText : "Astazi",
		    format : "Y-m-d",
		    startDay: 1 // Week start on Monday
		});		
      });		
	
	</script>		
<!-- custom libs -->
	
	<script type="text/javascript" src="resources/js/app/stylechanger.js"></script>	
	<script type="text/javascript" src="resources/js/app/php.js"></script>
	<script type="text/javascript" src="resources/js/app/app.js"></script>
		
<!-- custom css -->	
	<link rel="stylesheet" type="text/css" href="resources/css/app/app.css"/>

</head>
<body>
	<!-- Loading mask and image -->
	<div id="loading-mask"></div>
	<div id="loading">
		<div class="loading-indicator">Loading...</div>
	</div>

  <div id="west">
  	<!-- menu item -->
	
	<script type="text/javascript">
		
		/**
		 * @author gabrielpopa
		 */
		
		Ext.onReady(function() {
		    // Define Tree.
		    var loader = new Ext.tree.TreeLoader({
		        dataUrl   :"welcome/tree/" + Math.random()
		    });
		    var tree = new Ext.tree.TreePanel({
		        collapsible      : true,
		        animCollapse     : true,
		        border           : true,
		        id               : "tree-admin-div",
		        el               : "tree-admin-div",
		        autoScroll       : true,
		        autoHeight       : true,				
		        animate          : true,
		        containerScroll  : true,
		        loader           : loader,
				border			 : false,
				enableDD		 : false,
				rootVisible 	 : true,					//set to false if you don't want root visible
				listeners		 : {'click' : function(node) {
										if (node.leaf == true){
										   Ext.get("center").load({
										        url: node.attributes.link + "/" + Math.random(),
												method:'post',
										        scripts: true,
										        params: "",
												disableCaching:false,
										        text: "Loading " + node.attributes.text,
												callback: function (el, success, response, options){
														//Ext.log('info',node.attributes.link + '->menu load success: ' + success);
												}	
										   });											
										}
					            } // click
					            } // listeners	
		    });
		 
		    // SET the root node.
		    var root = new Ext.tree.AsyncTreeNode({
		        text		: 'Meniul principal',
		        draggable	: false,
		        id			: 'root',
				disabled	: true
		    });
		 
		    // Render the tree.
		    tree.setRootNode(root);
		    tree.render();
		    root.expand();
		});			
		
	</script>
	<div id="tree-admin-div"></div>
		
	<!-- end menu item -->
  </div>
  <div id="sett">
 
  	
  </div>  
  <div id="about-me">
    <p><label>Nume: 	</label><?=$session['us_N'];?></p>
	<p><label>ID: 		</label><?=$session['us_I'];?></p>
	<p><label>Rol: 		</label><?=$session['us_L'];?></p>
	<p><label>CNP: 		</label><?=$session['us_S'];?></p>
	<p><label>Compania: </label><?=$compania;?></p>
	<hr />
  </div>  
  <div id="north" align="center">
	<script type="text/javascript">
				Ext.onReady(function(){
					var tb = new Ext.Toolbar({
								autoWidth 	:true,
								autoHeight	:true,
								anchor		:'100%'
					});
					tb.render("north-toolbar");
					tb.add({
							text:  "<?=$compania;?>",
							enableToggle: false,
							pressed: false
					});	
					tb.addSeparator();		
					tb.add({
							text:  "Salut, <?=$session['us_N'];?>",
							enableToggle: false,
							pressed: false,
							iconCls: 'b_user_cls'
					});		
						
					tb.addSeparator();	
					
				    var action = new Ext.Action({
				        text: 'Logout',
				        handler: function(){
							Ext.Ajax.request({
							   url: 'welcome/logout/' + Math.random(),
							   disableCaching:false,
							   success: function(){
											Ext.Msg.show({
											   title:'Logout',
											   msg: 'Ati parasit cu succes sistemul'
											});	
											window.location="<?php echo $this->config->config['base_url'] ?>";
										},
							   failure: function(){Ext.Msg.alert('Logout','Eroare la parasirea sistemului!".');}
							});			
				        },
				        iconCls: 'b_logout_cls'
				    });	
					var b_act =  new Ext.Button(action)		
					tb.add('->',b_act);		
					
					tb.addSeparator();
					
					var store = new Ext.data.SimpleStore({
						fields: ['value', 'option'],
						data : [
							['#', 'Default'], 
							['xtheme-gray', 'xtheme-gray'], 
							['xtheme-olive', 'xtheme-olive'], 
							['xtheme-purple', 'xtheme-purple'], 
							['xtheme-slate', 'xtheme-slate'],
							['xtheme-green', 'xtheme-green'],
							['xtheme-indigo', 'xtheme-indigo'],
							['xtheme-silvercherry', 'xtheme-silvercherry']
						]
					});					
				    var combo = new Ext.form.ComboBox({
				        store: store,
						displayField: 'option',
						valueField: 'value',
				        mode: 'local',
						triggerAction: 'all',
				        emptyText:'[ Selectati tema ]',
				        selectOnFocus:true,
						forceSelection:true,
						editable:false
				    });
					combo.on('select', function() {
						setActiveStyleSheet(combo.getValue()); 
						return false;
					}, this);	
					
				    tb.addField(combo);

				});			
	</script>	
    <div align="left" id="north-toolbar"></div>
  </div>
  <div id="center">